<div id="subNav">
{$msgNav}
</div>
{literal}
<script>
$(document).ready(function(){
    $(".newMessageButton").unbind().bind("click", function(){Peopletab.modal.initModal(
		{modal: false, 
		 width: 500, 
		 height: 450,
		 modalID: "newMessage",
		 ajax: $(this).attr("href")}
	); return false});
		
	$(".newMessageLink").unbind().bind("click", function(){Peopletab.modal.initModal(
		{modal: false, 
		 width: 500, 
		 height: 450,
		 modalID: $(this).attr("id"),
		 ajax: $(this).attr("href")}
	); return false});
});
</script>
{/literal}
{if $errors}
<div id="errors">
{foreach item=error from=$errors}
<span class="error">{$error}</span><br>
{/foreach}
</div>
{/if}

{if $formResponse}
<div id="formResponse">{$formResponse}</div>
{/if}

{if $pager->links}
<div class="pager">
{$pager->links}
</div>
{/if}

<div class="blockCP">
<form {$form.attributes}>
<table border="0" id="cpMessageTable" class="cpTable" width="100%">
<tr>
<td colspan="3" valign="middle" align="left">{$form.btnSubmit.html}</td>
<td valign="middle" align="right" width="24%"><span class="button"><a href="/{$request->ownerName}/CP/Messages/new" class="newMessageButton">New Message</a></span></td>
</tr>
{if $noResults}
<tr>
<td colspan="4" valign="top" align="left"><p class="block">{$noResults}</p></td>
</tr>
{else}
<tr class="cpTableHeader">
<td>
</td>
<td>
Title	
</td>
<td>
From
</td>
<td>
Date
</td>
</tr>
{foreach item=message from=$messages}
<tr valign="top" class="cpTableRow">
<td>{$form[$message.idPrivateMsg].html}</td>
{if $message.readStatus == '1'}
<td><a href="/{$request->ownerName}/CP/Messages/read{$sent}/{$message.idPrivateMsg}" id="message{$message.idPrivateMsg}" onclick="Peopletab.readMessage({$message.idPrivateMsg}); return false">{$message.messageTitle|truncate:75:"...":true}</a></td>
{else}
<td><b><a href="/{$request->ownerName}/CP/Messages/read{$sent}/{$message.idPrivateMsg}" id="message{$message.idPrivateMsg}" onclick="Peopletab.readMessage({$message.idPrivateMsg}); return false">{$message.messageTitle|truncate:75:"...":true}</a></b></td>
{/if}
<td><a href="http://{$message.domain}/{$message.userName}">{$message.userName}@{$message.domain}</a></td>
<td>{$message.timeSent|date_format:"%D %I:%M %p"}</td>
</tr>
{/foreach}
{/if}
<tr>
<td colspan="3" valign="top" align="left">{$form.btnSubmit.html}</td>
<td valign="middle" align="right"><span class="button"><a href="/{$request->ownerName}/CP/Messages/new" class="newMessageButton">New Message</a></span></td>
</tr>
</table>
</form>
</div>

{if $pager->links}
<div class="pager">
{$pager->links}
</div>
{/if}

